
export function filterCallingMessage(currentMessageList) {
  currentMessageList.forEach((item) => {
    if (item.callType) {   // 对于自己伪造的消息不需要解析
      return
    }
    if (item.type === TIM.TYPES.MSG_MERGER && item.payload.downloadKey !== '') {
      let promise = window.tim.downloadMergerMessage(item)
      promise.then(function(imResponse) {
        // 下载成功后，SDK会更新 message.payload.messageList 等信息
        item = imResponse
      }).catch(function(imError) {
        // 下载失败
        console.warn('downloadMergerMessage error:', imError)
      })
    }
    if(item.type === TIM.TYPES.MSG_CUSTOM) {
      let payloadData = {}
      try {
        payloadData = JSON.parse(item.payload.data)
      }catch (e) {
        payloadData = {}
      }
      if(payloadData.businessID === 1) {
   //      if(item.conversationType === TIM.TYPES.CONV_GROUP) {
   //        if(payloadData.actionType === 5) {
   //          item.nick = payloadData.inviteeList ? payloadData.inviteeList.join(','):item.from
   //        }
   //        let _text = this.trtcCalling.extractCallingInfoFromMessage(item)
   //        let group_text = `${_text}`
   //        item.type = TIM.TYPES.MSG_GRP_TIP
   //        let customData = {
   //          operationType: 256,
   //          text: group_text,
   //          userIDList: []
   //        }
   //        item.payload = customData//JSON.stringify(customData)
   //      }
   //      if(item.conversationType === TIM.TYPES.CONV_C2C) {
			// console.log(item);
   //        let c2c_text = this.trtcCalling.extractCallingInfoFromMessage(item)
   //        let customData = {
   //          text: c2c_text
   //        }
   //        item.payload = customData//JSON.stringify(customData)
   //      }
      }
    }

  })
}